
import amoyData from '../../../common/microAmoyData.js'//调用数据

export default {
  data: {
    navbarData: ['关注', '推荐', '直播', '畅享', '福利', '视频'],//分类设置
    tempList: [],
    beginIndex: 0,
    endIndex: 0,
    amoyData:amoyData,//数据赋值
  },
  onInit() {
  },
  buildItem(param) {//遍历数据
    if (this.amoyData.length == 0) {
      return;
    }
    this.beginIndex = param.begin;
    this.endIndex = param.end;
    let tempArray = [];
    for (let index = this.beginIndex;index < this.endIndex; ++index) {
      let tempIndex = index % this.amoyData.length;
      let tempValue = JSON.parse(JSON.stringify(this.amoyData[tempIndex]));
      tempValue.index = index + 1;
      tempArray.push(tempValue);
    }
    this.tempList = tempArray;
  }
}